<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>product</title>
  <script type="text/javascript" src="../frame/assets/js/lib/jquery.min.js"></script>
  <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
  <script src="../frame/layui/lay/modules/layer.js"></script>
  <link rel="stylesheet" href="../frame/layui/lay/modules/layer/default/layer.css">
  <link rel="stylesheet" href="../frame/layui/css/layui.css"  media="all">

</head>
<body>
<div class="content-wrap">
  <div class="main">
    <div class="container-fluid">


      <div class="layui-card-body">
        <table id="user-table" lay-filter="user-table"></table>
      </div>
      <br><br>
    </div>
  </div>
</div>
<!--搜索-->
<div id="search">
  <button type="button" class="close">×</button>
  <form>
    <input type="search" value="" placeholder="type keyword(s) here" />
    <button type="submit" class="btn btn-primary">Search</button>
  </form>
</div>

<script type="text/javascript" src="../frame/layui/layui.js" charset="utf-8"></script>

<script>
  layui.use('table', function()
  {
    var table = layui.table;
    //第一个实例
    table.render({
       elem: '#user-table'
      ,height: '850px'
      ,url: '/showaffairs' //数据接口
      ,method:'get'
      ,cols: [[ //表头
        {field:'title', width:830, title: '标题', align:'center',style:'text-align: center;'}
        ,{field:'date', width:830, title: '时间', align:'center', style:'text-align: center;',sort: true}
        ,{field:'id',hide:true}
        ,{field:'context',hide:true}
      ]]
    });
    //监听行单击事件（双击事件为：rowDouble）
    table.on('row(user-table)', function(obj){
      var data1 = obj.data;
     var data2=JSON.stringify(data1);
      var data = eval('(' + data2 + ')');

      var url= 'showaffairsinfo.html?id='+data.id;
      layer.open({
        type: 2,
        title: '党务政务村务公开',
        shade: 0.8,
        area: ['900px', '90%'],
        content: url
      });
    });
  });



</script>

</body>
</html>
